package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserMapper {
    /*
        1.创建预编译SQL的执行对象;
        2.设置占位符?的值;
        3.执行预编译SQL;
     */
    //@Insert("INSERT INTO user(username,password,nickname,created) VALUES (#{username},#{password},#{nickname},#{created})")

    int insertUser(User user);

    /*
    未来在调用该方法时;
    UserMapper userMapper = new UserMapper();
    User user = new User();
    user.setUsername("赵丽颖")
    user.setPassword("123456")
    user.setNickname("赵小刀")
    user.setCreated(new Date())
    userMapper.insertUser(user);
     */
}
